<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>三个盒子</title>
		<style type="text/css">
			div{
				width: 100px;
				height: 100px;
				background: palegreen;
				margin-bottom: 10px;
			}
			#box3{
				display: none;
				background: plum;
			}
		</style>
		
		<!--进入1,3显示；点击1,2变色；离开1,1隐藏-->
		<script>
			//进入box1，box3显示
			function xianshi(){
				document.getElementById('box3').style.display='block';
			}
			//点击box1，box2变色
			function change_color(){
				document.getElementById('box2').style.background='goldenrod';

			}
			//离开box1，box1隐藏
			function yincang(){
				document.getElementById('box1').style.display='none';
			}
		</script>
	</head>
	<body>
		<div id="box1" onmouseover="xianshi()" onclick="change_color()" onmouseout="yincang()">
			111
		</div>
		<div id="box2" onclick="xinashi">222</div>
		<div id="box3">333</div>
	</body>
</html>
